// uni 路由

export const navigateTo = (url) => {
	uni.navigateTo({
		url,
		success: () => {
			console.log("跳转页面成功")
		},
		fail: (err) => {
			console.error("路由跳转失败-->", err)
		}
	})
}

export const navigateBack = () => {
	uni.navigateBack({
		success: () => {
			console.log("返回页面成功")
		},
		fail: (err) => {
			console.error("路由返回失败-->", err)
		}
	})
}

// showToast 提示框
export const toast = (title, icon = 'success', duration = 2000) => {
	uni.showToast({
		title,
		icon,
		duration,
		success: () => {
			console.log(title)
		},
		fail: () => {
			console.error(title)
		}
	})
}

// showLoading 加载提示
export const showLoading = (title, mask = true) => {
	uni.showLoading({
		title,
		mask
	})
}

export const hideLoading = () => {
	uni.hideLoading()
}